
***********************************************************************************************************************************************************
*	Replication code for "Does Descriptive Representation of Women on the Bench Improve Institutional Trust?" (Laura P. Moyer, Journal of Law and Courts)
*	Models and code for tables and figures
*	Dataset for Study 1: "descriptive_representation_study_1_complete.dta"
*	Dataset for Study 2: "descriptive_representation_study_2_complete.dta""
***********************************************************************************************************************************************************


************************************************************************

*FIGURE 1: Ordered Logit Models of Trust in Federal Courts (Study 1)
**Data: use "descriptive_representation_study_1_complete.dta"

*	FIGURE 1, PANEL A. (Coefficient Plot for Baseline Model)
ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college i.rep sexism scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]
est store gender_w2_coefplot2 
 
coefplot (gender_w2_coefplot2, mcolor(black) ciopts(lcol(gray))), grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

*	FIGURE 1, PANEL B. (Coefficient Plot for Interaction Model, Study 1)
ologit dv_ge i.conditions_ge##i.female i.hispanic i.race i.college i.rep sexism scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]
est store genderint_w2_coefplot2

coefplot (genderint_w2_coefplot2, mcolor(black) ciopts(lcol(gray))), grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

************************************************************************
*FIGURE 2: Predicted Probabilities of Trust in Federal Courts (Study 1)
**Data: use "descriptive_representation_study_1_complete.dta"

qui ologit dv_ge ib2.conditions_ge i.female i.hispanic i.race i.college i.rep sexism scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]
 
mgen, at(conditions_ge=(1(1)2)) stub(C_) atmeans

label var C_pr1 "Strongly Disagree"
label var C_pr2 "Disagree"
label var C_pr3 "Neither"
label var C_pr4 "Agree"
label var C_pr5 "Strongly Agree"

graph twoway connected C_pr1 C_pr2 C_pr3 C_pr4 C_pr5 C_conditions_ge, title("Effect of women's judicial representation on trust") xtitle("Women's Representation") xlabel(1(1)2) ytitle("Predicted Probabilities") ylabel(0(.1).5)

************************************************************************
*FIGURE 3: Ordered Logit Models of Trust in Federal Courts (Study 2)
**Data: use "descriptive_representation_study_2_complete.dta"

*	FIGURE 3, PANEL A. (Coefficient Plot for Baseline Model)
ologit dv_ge ib2.conditions_ge i.female i.hispanic i.race i.college i.rep c.sexism2 scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]
est store gender_w3_coefplot2 
 
coefplot (gender_w3_coefplot2, mcolor(black) ciopts(lcol(gray))), grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

*	FIGURE 3, PANEL B. (Coefficient Plot for Interaction Model, Study 2)

ologit dv_ge i.conditions_ge##i.female i.hispanic i.race i.college i.rep c.sexism2 scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]

est store genderint_w3_coefplot2 
 
coefplot (genderint_w3_coefplot2, mcolor(black) ciopts(lcol(gray))), grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

************************************************************************
* FIGURE 4: Selected Output from Ordered Logit Models by Partisanship (Studies 1 and 2)

* 	FIGURE 4 PANEL A (Democrats only, Study 1)
*	Data: use "descriptive_representation_study_1_complete.dta"
ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college sexism scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy if rep == 0 [aweight=weights]

coefplot, keep (*conditions_ge *female) grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

*	FIGURE 4 PANEL A (Republicans only, Study 1)
*	Data: use "descriptive_representation_study_1_complete.dta"
ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college sexism scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy if rep == 1 [aweight=weights]

coefplot, keep (*conditions_ge *female) grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

*	FIGURE 4 PANEL B (Democrats only, Study 2)
*	Data: use "descriptive_representation_study_2_complete.dta"

ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college c.sexism2 scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy if rep == 0 [aweight=weights]

coefplot, keep (*conditions_ge *female) grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

*	FIGURE 4 PANEL B (Republicans only, Study 2)
*	Data: use "descriptive_representation_study_2_complete.dta"
ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college c.sexism2 scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy if rep == 1 [aweight=weights]

coefplot, keep (*conditions_ge *female) grid(none) graphregion(fcolor(white) lcolor(black) lwidth(medium)) plotregion(fcolor(white)) xline(0, lcolor(black)) xscale(range(-.8 1)) xlabel(-.8(.2)1)

************************************************************************
*FIGURE 5 (Pred prob of trust in federal courts for Democrats]

* 	FIGURE 5, PANEL A. Study 1 (Democrats only)
*	Data: use "descriptive_representation_study_1_complete.dta"
qui ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college sexism scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy if rep == 0 [aweight=weights]

mgen, at(conditions_ge=(1(1)2)) stub(P_) atmeans

label var P_pr1 "Strongly Disagree"
label var P_pr2 "Disagree"
label var P_pr3 "Neither"
label var P_pr4 "Agree"
label var P_pr5 "Strongly Agree"

graph twoway connected P_pr1 P_pr2 P_pr3 P_pr4 P_pr5 P_conditions_ge, title("Effect of women's judicial representation on Democrats' trust")  xlabel(1(1)2) ytitle("Predicted Probabilities") ylabel(0(.1).5)

* 	FIGURE 5, PANEL B. Study 2 (Democrats only)
*	Data: use "descriptive_representation_study_2_complete.dta"
qui ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college c.sexism2 scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy if rep == 0 [aweight=weights]

mgen, at(conditions_ge=(1(1)2)) stub(P_) atmeans

label var P_pr1 "Strongly Disagree"
label var P_pr2 "Disagree"
label var P_pr3 "Neither"
label var P_pr4 "Agree"
label var P_pr5 "Strongly Agree"

graph twoway connected P_pr1 P_pr2 P_pr3 P_pr4 P_pr5 P_conditions_ge, title("Effect of women's judicial representation on Democrats' trust")  xlabel(1(1)2) ytitle("Predicted Probabilities") ylabel(0(.1).5)

************************************************************************
*	ONLINE APPENDIX - alternate specifications without controlling for hostile sexism measure
*	Study 1: ordered logit model
*	Data: use "descriptive_representation_study_1_complete.dta"
ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college i.rep c.scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]

*	Study 2 ordered logit model
*	Data: use "descriptive_representation_study_2_complete.dta"
ologit dv_ge i.conditions_ge i.female i.hispanic i.race i.college i.rep c.scotusknow c.scotusft c.pf1 c.experience i.dobbs_dummy [aweight=weights]
